import request from '@/router/axios';

//查询所有项目成员
export const getAllMembers = (params) => {
  return request({
    url: '/api/hg-public/controlplan/getAllMembers',
    method: 'get',
    params: {
      ...params,
    }
  })
}
//控制计划列表
export const getControlplanList = (params) => {
  return request({
    url: '/api/hg-public/controlplan/page',
    method: 'get',
    params: {
      ...params,
    }
  })
}

//最新控制计划
export const getNewestControlplan = (params) => {
  return request({
    url: '/api/hg-public/controlplan/getLastControlPlanByProductId',
    method: 'get',
    params: {
      ...params,
    }
  })
}
//更新 
export const updateControlplan = (row) => {
  return request({
    url: '/api/hg-public/controlplan/submit',
    method: 'post',
    data: row
  })
}

//删除 
export const removeControlplan = (ids) => {
  return request({
    url: '/api/hg-public/controlplan/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}
//获取全部产品
export const getAllProduct = () => {
  return request({
    url: '/api/hg-public/controlplan/listProduct',
    method: 'get',
  })
}
//提交
export const submitControlplan = (controlPlanId) => {
  return request({
    url: '/api/hg-public/controlplan/start-process',
    method: 'get',
    params: {
      controlPlanId,
    }
  })
}
//获取控制计划详细list
export const getDetailPlans = (productId, controlPlanId) => {
  return request({
    url: '/api/hg-public/controlplan/getConPlanDetail',
    method: 'get',
    params: {
      productId,
      controlPlanId
    }
  })
}
// 获取责任人
export const getPersons = (params) => {
  return request({
    url: '/api/hg-public/prodplanlist/getPersons',
    method: 'get',
    params: {
      ...params
    }
  })
}